package java_0441_enum;

public class Homework08 {
    public static void main(String[] args) {
        Color green = Color.GREEN;
        green.show();
        //枚举的switch,switch中放入枚举对象
        switch (green){
            case YELLOW :
                System.out.println("YELLOW");
                break;
            case GREEN:{
                System.out.println("GREEN");
                break;
            }
            default:
                break;
        }
    }
}
interface MyInterface{
    public void show();
}
enum Color implements MyInterface{
    RED(255,0,0),BLUE(0,0,255),YELLOW(255,255,0),
    GREEN(0,255,0);
    private int redValue;
    private int greenValue;
    private int blueValue;

    Color(int redValue, int greenValue, int blueValue) {
        this.redValue = redValue;
        this.greenValue = greenValue;
        this.blueValue = blueValue;
    }

    @Override
    public void show() {
        System.out.println(redValue+","+blueValue+","+greenValue);
    }
}